package com.gwcm.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gwcm.exception.BusinessException;
import com.gwcm.model.dto.orderInfo.CardOrderInfoQueryRequest;
import com.gwcm.model.dto.orderInfo.OrderInfoQueryRequest;
import com.gwcm.model.vo.CardOrderInfoVo;
import com.gwcm.model.vo.OrderInfoVo;
import com.gwcm.service.CardOrderInfoService;
import com.gwcm.service.OrderInfoService;
import com.yhz.commonutil.common.BaseResponse;
import com.yhz.commonutil.common.ResultUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/cardOrderInfo")
@Api(tags = "会员卡订单信息接口")
public class CardOrderInfoController {
    @Autowired
    public CardOrderInfoService cardOrderInfoService;

    @ApiOperation("分页查询会员卡订单信息接口")
    @PostMapping("/page")
    public BaseResponse<IPage<CardOrderInfoVo>> pageModuleTopic(@RequestBody CardOrderInfoQueryRequest cardOrderInfoQueryRequest) throws BusinessException {
        IPage<CardOrderInfoVo> cardOrderInfoVoIPage = cardOrderInfoService.pageList(cardOrderInfoQueryRequest);
        return ResultUtils.success(cardOrderInfoVoIPage);
    }
}
